# -*- coding: utf-8 -*-
import scrapy


class S02Spider(scrapy.Spider):
    name = 's02'
    allowed_domains = ['https://blog.csdn.net/']
    # start_urls = ['http://https://blog.csdn.net//']
    # def parse(self, response):
    #     print(response.body)
    #     print('#'*30)
    #     print(response.xpath('//div[@class="nav_com"]/ul/li/a/text()').extract())
    #     print('#'*30)

    def start_requests(self):
        yield scrapy.Request(
            url='https://blog.csdn.net/',
            callback=self.parse2
        )

    def parse2(self, response):
        print(response.body)
        print('#' * 30)
        print(response.xpath('//div[@class="nav_com"]//li/a/text()').extract())
        print('#' * 30)
